// File generated from our OpenAPI spec by Stainless.

package com.metest.api.services.blocking.rest.actuator

import com.google.errorprone.annotations.MustBeClosed
import com.metest.api.core.ClientOptions
import com.metest.api.core.RequestOptions
import com.metest.api.core.http.HttpResponse
import com.metest.api.core.http.HttpResponseFor
import com.metest.api.models.rest.actuator.caches.CachClearParams
import com.metest.api.models.rest.actuator.caches.CachDeleteByNameParams
import com.metest.api.models.rest.actuator.caches.CachListParams
import com.metest.api.models.rest.actuator.caches.CachListResponse
import com.metest.api.models.rest.actuator.caches.CachRetrieveByNameParams
import com.metest.api.models.rest.actuator.caches.CachRetrieveByNameResponse
import java.util.function.Consumer

interface CachService {

    /**
     * Returns a view of this service that provides access to raw HTTP responses for each method.
     */
    fun withRawResponse(): WithRawResponse

    /**
     * Returns a view of this service with the given option modifications applied.
     *
     * The original service is not modified.
     */
    fun withOptions(modifier: Consumer<ClientOptions.Builder>): CachService

    /** Actuator web endpoint 'caches' */
    fun list(): CachListResponse = list(CachListParams.none())

    /** @see list */
    fun list(
        params: CachListParams = CachListParams.none(),
        requestOptions: RequestOptions = RequestOptions.none(),
    ): CachListResponse

    /** @see list */
    fun list(params: CachListParams = CachListParams.none()): CachListResponse =
        list(params, RequestOptions.none())

    /** @see list */
    fun list(requestOptions: RequestOptions): CachListResponse =
        list(CachListParams.none(), requestOptions)

    /** Actuator web endpoint 'caches' */
    fun clear() = clear(CachClearParams.none())

    /** @see clear */
    fun clear(
        params: CachClearParams = CachClearParams.none(),
        requestOptions: RequestOptions = RequestOptions.none(),
    )

    /** @see clear */
    fun clear(params: CachClearParams = CachClearParams.none()) =
        clear(params, RequestOptions.none())

    /** @see clear */
    fun clear(requestOptions: RequestOptions) = clear(CachClearParams.none(), requestOptions)

    /** Actuator web endpoint 'caches-cache' */
    fun deleteByName(cache: String) = deleteByName(cache, CachDeleteByNameParams.none())

    /** @see deleteByName */
    fun deleteByName(
        cache: String,
        params: CachDeleteByNameParams = CachDeleteByNameParams.none(),
        requestOptions: RequestOptions = RequestOptions.none(),
    ) = deleteByName(params.toBuilder().cache(cache).build(), requestOptions)

    /** @see deleteByName */
    fun deleteByName(
        cache: String,
        params: CachDeleteByNameParams = CachDeleteByNameParams.none(),
    ) = deleteByName(cache, params, RequestOptions.none())

    /** @see deleteByName */
    fun deleteByName(
        params: CachDeleteByNameParams,
        requestOptions: RequestOptions = RequestOptions.none(),
    )

    /** @see deleteByName */
    fun deleteByName(params: CachDeleteByNameParams) = deleteByName(params, RequestOptions.none())

    /** @see deleteByName */
    fun deleteByName(cache: String, requestOptions: RequestOptions) =
        deleteByName(cache, CachDeleteByNameParams.none(), requestOptions)

    /** Actuator web endpoint 'caches-cache' */
    fun retrieveByName(cache: String): CachRetrieveByNameResponse =
        retrieveByName(cache, CachRetrieveByNameParams.none())

    /** @see retrieveByName */
    fun retrieveByName(
        cache: String,
        params: CachRetrieveByNameParams = CachRetrieveByNameParams.none(),
        requestOptions: RequestOptions = RequestOptions.none(),
    ): CachRetrieveByNameResponse =
        retrieveByName(params.toBuilder().cache(cache).build(), requestOptions)

    /** @see retrieveByName */
    fun retrieveByName(
        cache: String,
        params: CachRetrieveByNameParams = CachRetrieveByNameParams.none(),
    ): CachRetrieveByNameResponse = retrieveByName(cache, params, RequestOptions.none())

    /** @see retrieveByName */
    fun retrieveByName(
        params: CachRetrieveByNameParams,
        requestOptions: RequestOptions = RequestOptions.none(),
    ): CachRetrieveByNameResponse

    /** @see retrieveByName */
    fun retrieveByName(params: CachRetrieveByNameParams): CachRetrieveByNameResponse =
        retrieveByName(params, RequestOptions.none())

    /** @see retrieveByName */
    fun retrieveByName(cache: String, requestOptions: RequestOptions): CachRetrieveByNameResponse =
        retrieveByName(cache, CachRetrieveByNameParams.none(), requestOptions)

    /** A view of [CachService] that provides access to raw HTTP responses for each method. */
    interface WithRawResponse {

        /**
         * Returns a view of this service with the given option modifications applied.
         *
         * The original service is not modified.
         */
        fun withOptions(modifier: Consumer<ClientOptions.Builder>): CachService.WithRawResponse

        /**
         * Returns a raw HTTP response for `get /rest/actuator/caches`, but is otherwise the same as
         * [CachService.list].
         */
        @MustBeClosed fun list(): HttpResponseFor<CachListResponse> = list(CachListParams.none())

        /** @see list */
        @MustBeClosed
        fun list(
            params: CachListParams = CachListParams.none(),
            requestOptions: RequestOptions = RequestOptions.none(),
        ): HttpResponseFor<CachListResponse>

        /** @see list */
        @MustBeClosed
        fun list(
            params: CachListParams = CachListParams.none()
        ): HttpResponseFor<CachListResponse> = list(params, RequestOptions.none())

        /** @see list */
        @MustBeClosed
        fun list(requestOptions: RequestOptions): HttpResponseFor<CachListResponse> =
            list(CachListParams.none(), requestOptions)

        /**
         * Returns a raw HTTP response for `delete /rest/actuator/caches`, but is otherwise the same
         * as [CachService.clear].
         */
        @MustBeClosed fun clear(): HttpResponse = clear(CachClearParams.none())

        /** @see clear */
        @MustBeClosed
        fun clear(
            params: CachClearParams = CachClearParams.none(),
            requestOptions: RequestOptions = RequestOptions.none(),
        ): HttpResponse

        /** @see clear */
        @MustBeClosed
        fun clear(params: CachClearParams = CachClearParams.none()): HttpResponse =
            clear(params, RequestOptions.none())

        /** @see clear */
        @MustBeClosed
        fun clear(requestOptions: RequestOptions): HttpResponse =
            clear(CachClearParams.none(), requestOptions)

        /**
         * Returns a raw HTTP response for `delete /rest/actuator/caches/{cache}`, but is otherwise
         * the same as [CachService.deleteByName].
         */
        @MustBeClosed
        fun deleteByName(cache: String): HttpResponse =
            deleteByName(cache, CachDeleteByNameParams.none())

        /** @see deleteByName */
        @MustBeClosed
        fun deleteByName(
            cache: String,
            params: CachDeleteByNameParams = CachDeleteByNameParams.none(),
            requestOptions: RequestOptions = RequestOptions.none(),
        ): HttpResponse = deleteByName(params.toBuilder().cache(cache).build(), requestOptions)

        /** @see deleteByName */
        @MustBeClosed
        fun deleteByName(
            cache: String,
            params: CachDeleteByNameParams = CachDeleteByNameParams.none(),
        ): HttpResponse = deleteByName(cache, params, RequestOptions.none())

        /** @see deleteByName */
        @MustBeClosed
        fun deleteByName(
            params: CachDeleteByNameParams,
            requestOptions: RequestOptions = RequestOptions.none(),
        ): HttpResponse

        /** @see deleteByName */
        @MustBeClosed
        fun deleteByName(params: CachDeleteByNameParams): HttpResponse =
            deleteByName(params, RequestOptions.none())

        /** @see deleteByName */
        @MustBeClosed
        fun deleteByName(cache: String, requestOptions: RequestOptions): HttpResponse =
            deleteByName(cache, CachDeleteByNameParams.none(), requestOptions)

        /**
         * Returns a raw HTTP response for `get /rest/actuator/caches/{cache}`, but is otherwise the
         * same as [CachService.retrieveByName].
         */
        @MustBeClosed
        fun retrieveByName(cache: String): HttpResponseFor<CachRetrieveByNameResponse> =
            retrieveByName(cache, CachRetrieveByNameParams.none())

        /** @see retrieveByName */
        @MustBeClosed
        fun retrieveByName(
            cache: String,
            params: CachRetrieveByNameParams = CachRetrieveByNameParams.none(),
            requestOptions: RequestOptions = RequestOptions.none(),
        ): HttpResponseFor<CachRetrieveByNameResponse> =
            retrieveByName(params.toBuilder().cache(cache).build(), requestOptions)

        /** @see retrieveByName */
        @MustBeClosed
        fun retrieveByName(
            cache: String,
            params: CachRetrieveByNameParams = CachRetrieveByNameParams.none(),
        ): HttpResponseFor<CachRetrieveByNameResponse> =
            retrieveByName(cache, params, RequestOptions.none())

        /** @see retrieveByName */
        @MustBeClosed
        fun retrieveByName(
            params: CachRetrieveByNameParams,
            requestOptions: RequestOptions = RequestOptions.none(),
        ): HttpResponseFor<CachRetrieveByNameResponse>

        /** @see retrieveByName */
        @MustBeClosed
        fun retrieveByName(
            params: CachRetrieveByNameParams
        ): HttpResponseFor<CachRetrieveByNameResponse> =
            retrieveByName(params, RequestOptions.none())

        /** @see retrieveByName */
        @MustBeClosed
        fun retrieveByName(
            cache: String,
            requestOptions: RequestOptions,
        ): HttpResponseFor<CachRetrieveByNameResponse> =
            retrieveByName(cache, CachRetrieveByNameParams.none(), requestOptions)
    }
}
